﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QWModel;
using QWTouchPanel.Properties;

namespace QWTouchPanel
{
    /// <summary>
    /// AccessCodeUI : Form
    /// </summary>
    public partial class AccessCodeUI : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AccessCodeUI"/> class.
        /// </summary>
        public AccessCodeUI()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Handles the Click event of the qwButton1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void qwButton1_Click(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton1_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton2 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton2_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton3 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton3_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton4 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton4_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton5 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton5_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton6 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton6_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton7 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton7_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton8 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton8_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton9 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton9_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton10 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton10_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Text += ((QWBoxButton)sender).Text;
        }

        /// <summary>
        /// Handles the MouseDown event of the qwBoxButton11 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwBoxButton11_MouseDown(object sender, MouseEventArgs e)
        {
            txtUnlockCode.Clear();
        }

        /// <summary>
        /// Handles the MouseDown event of the qwButton1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwButton1_MouseDown(object sender, MouseEventArgs e)
        {
            if (txtUnlockCode.Text.Trim().Equals(Settings.Default.UnlockCode))
            {
                DialogResult = DialogResult.OK;
            }
            else
            {
                txtUnlockCode.Clear();
                MessageBox.Show(@"Akses ditolak !", @"Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
    }
}
